package com.zhang.zhangapp.view.custom;

import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.WindowManager;
import android.widget.TextView;

import com.zhang.zhangapp.R;
import com.zhang.zhangapp.utils.ScreenUtils;

/**
 * Created by 罗肖 on 2018/4/10.
 */

public class SexDialog extends Dialog {

    TextView manText;
    TextView womanText;
    public SexDialog(@NonNull Context context) {
        super(context,R.style.CustomDialogStyle);
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.sex_dialog);
        manText = (TextView)findViewById(R.id.sex_man);
        womanText = (TextView)findViewById(R.id.sex_woman);

        WindowManager.LayoutParams layoutParams = this.getWindow().getAttributes();
        layoutParams.width =(int) (ScreenUtils.getScreenWidth(getContext()) * 0.7);
        layoutParams.height = (int) (ScreenUtils.getScreenWidth(getContext()) * 0.7 *0.8);
        this.getWindow().setGravity(Gravity.CENTER);
        this.getWindow().setAttributes(layoutParams);
    }

    public void setOnClickListener(View.OnClickListener listener){
        manText.setOnClickListener(listener);
        womanText.setOnClickListener(listener);
    }
}
